<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>修改密码</title>
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<![endif]-->
<!-- Main Stylesheet --> 
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css" type="text/css" />
<!-- Your Custom Stylesheet --> 
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/custom.css" type="text/css" />
<%@include file="/include/header.jsp" %>
<script src="<%=request.getContextPath()%>/js/jquery/jquery-1.4.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/validator/formValidator_min.js"></script>
<script src="<%=request.getContextPath()%>/js/validator/formValidatorRegex.js"></script>
<script src="<%=request.getContextPath()%>/js/function.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$.formValidator.initConfig({
			formID:"changepwd",
			submitOnce:true,
			onError:function(msg){
				showTip(msg);
			},
			onSuccess:function(){
				if( confirm("准备提交数据，是否继续？") ){
					Mask.show();
					$('#changepwd').ajaxSubmit(Ajax.callback);
				}
				return false;
			}
		});
		$("#oldpwd").formValidator({
			onShow:"请输入当前密码",
			onFocus:"请输入当前密码，2-16个字符"
		}).inputValidator({min:2,max:16});
		$("#newpwd").formValidator({
			onShow:"请输入新密码",
			onFocus:"请输入新密码，2-16个字符"
		}).inputValidator({min:5,max:16});
		$("#repeatpwd").formValidator({
			onShow:"请再次输入新密码",
			onFocus:"请再次输入新密码，2-16个字符"
		}).compareValidator({desID:"newpwd", onError:"两次密码输入不一致"});
	});
</script>
</head>
<body style="background-color: #fff;">
	<%@include file="/include/body.jsp" %>
	
<s:if test="flag">
	<!-- 显示操作成功 -->
	<script type="text/javascript">
		$("#changepwd").get(0).reset();
		showTip("操作成功");
	</script>
</s:if>

<!-- Wrapper -->
<div class="wrapper">
	<div class="content-box" id="query_area">
    	<header>
			<h3>修改密码</h3>
		</header>
	<!-- Left column/section -->
	<section>
		<div class="box box-info">带*为必填项</div>
		
		<form id="changepwd" name="changepwd" onsubmit="return false;" action="<%=request.getContextPath()%>/protected/system/userConfig_changePassword.action" method="post">
		<table class="no-style">
			<tr>
				<td><label class="required">密码</label></td>
				<td><input id="oldpwd" type="password" name="oldpwd" value=""/></td>
				<td><div id="oldpwdTip"></div></td>
			</tr>
			<tr>
				<td><label class="required">新密码</label></td>
				<td><input id="newpwd" type="password" name="newpwd" value=""/></td>
				<td><div id="newpwdTip"></div></td>
			</tr>
			<tr>
				<td><label class="required">再次输入新密码</label></td>
				<td><input id="repeatpwd" type="password" name="_repeatpwd" value=""/></td>
				<td><div id="repeatpwdTip"></div></td>
			</tr>
		</table>
		<p><button type="submit" class="btn btn-green big"><span class="icon icon-ok"></span>提交</button></p>
		</form>
	</section>
	</div>
</div>
<!-- End of Wrapper -->
</body>
</html>